package com.wk.springboot.file.filter;

import java.io.File;
import org.apache.commons.io.monitor.FileAlterationListenerAdaptor;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;

/**
 * @Classname DiskReceiveFilter
 * @Description 本地磁盘接收端过滤器
 * @Date 2019/11/27 11:13
 * @Author by weikai
 */

public class DiskReceiveFilter extends FileAlterationListenerAdaptor {

  private Logger log = LoggerFactory.getLogger(DiskReceiveFilter.class);

  /**
   * 文件创建执行
   */
  @Override
  public void onFileCreate(File file) {
    log.info("监听接收端接收到了文件，路径是:{}",file.getAbsolutePath());
  }

  /**
   * 文件删除
   */
  @Override
  public void onFileDelete(File file) {
    log.info("==================成功删除:{}",file.getAbsolutePath());
  }
}
